<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" href="./css/jfv.css" type="text/css">
<script src="./js/jquery-1.9.1.js" type="text/javascript"></script>
<script src="./js/jquery-form-validator.js" type="text/javascript"></script>
</head>
<body>
<br/>
<br/>
<br/>
<br/>
<form name="testForm" id="testForm" action="http://www.baidu.com" method="post" onSubmit="return test();">
<table width="100%" border="0">
  <tr>
    <td width="50%" align="right"><input name="username" type="text" id="username" regexp="^\d{6}$" value="123456" leftTrim="false" require="false" requireErrMsg="不能为空"/></td>
    <td align="left">&nbsp;</td>
  </tr>
  <tr>
    <td align="right"><input name="password" type="text" id="password" style="background-color:#0033FF" regexp="^\d{5}$" value="23456" errMsg="必须为5个数字"/></td>
    <td align="left">fun<input name="password4" type="text" id="password4"  errMsg="邮箱格式不正确" ajaxErrMsg="邮箱已被注册" ajax1="http://localhost:8080/jfv/ajax.html" validFun="test(this);" funErrMsg="执行自定义验证未通过"/></td>
  </tr>
  <tr>
    <td align="right"><select name="sex" id="sex">
	<option value="1">男</option>
	<option value="0">女</option>
	</select></td>
    <td align="left"><input name="password3" type="text" id="password3" equalFieldId="password2" equalErrMsg="与比较项不一致"/></td>
  </tr>
  <tr>
    <td align="right"><input name="password2" type="text" id="password2" min="1" maxFieldId="username" value="456" maxErrMsg="不能超过username"/></td>
    <td align="left"><input type="submit" name="Submit" value="提交" /></td>
  </tr>
</table>
</form>
<script language="javascript">
	var j$ = jQuery.noConflict();
	j$("form[name='testForm']").FormValidate({suffix:true});
	function test(obj){
	//alert("onFun"+obj);
		if(event.srcElement.value==123)return true;
		else return false;
	}
</script>
</body>
</html>
